package Grammar;
/*强制类型转换：自动类型提升的逆运算*/
// 1.用() 强制换符
//2.可能会导致精度损失

/**
 * @author shkstart
 * @date 2022/3/28 - 21:01
 */
public class Cast {
    public static void main(String[] args) {
        double d1 = 123.4;
        int i1 = (int)d1;
        System.out.println("i1 = " + i1);

        long l1 = 132l;
        int i2 = (int)l1;
        System.out.println("i2 = " + i2);

        int i3 = 128;
        byte b1 = (byte)i3;
        System.out.println("b1 = " + b1);
    }



}
